home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_02
/
8n02046a
< prev
next >
Wrap
Text File
|
1990-02-28
|
715b
|
29 lines
*****Listing 2*****
001 /* obj.h - Interface to module for object oriented
002 programming in C. */
003
004 struct class {
005 int size; /* size of data */
006 int nbr_methods;
007 void (**method)();
008 };
009
010 typedef struct class CLASS;
011
012 typedef struct {
013 void *data;
014 CLASS *class;
015 } OBJECT;
016
017 void new_class(CLASS *class, CLASS *super_class,
018 int nbr_methods, int size);
019 void reg_method(CLASS *class, int mth, void (*fcn)());
020 void new_object(OBJECT *obj, CLASS *class);
021 void message(OBJECT *obj, int msg, ...);
022 void free_object(OBJECT *obj);
023 void free_class(CLASS *class);